/*
 ============================================================================
 Name		: TradeBlockChangePwd.h
 Author	  : spring xu
 Version	 : 1.0
 Copyright   : Your copyright notice
 Description : CTradeBlockChangePwd declaration
 ============================================================================
 */

#ifndef TRADEFUNDCHANGEPWD_H
#define TRADEFUNDCHANGEPWD_H

// INCLUDES
#include "TradeBlock.h"
#include "Control.h"
#include "TradeBlockNetwork.h"

// CLASS DECLARATION

class CTradeFundChangePwd: public CTradeBlock, public MPushButtonObserver//,public MReqObserver
{
public:
    ~CTradeFundChangePwd();

    static CTradeFundChangePwd* NewL(CBaseBlock* bsBack = NULL);

    static CTradeFundChangePwd* NewLC(CBaseBlock* bsBack);

private:
    CTradeFundChangePwd(CBaseBlock* bsBack);
    
    void ConstructL();

public:
    void OnDraw(CFbsBitGc& g) const;

    void OnKeyDown(TInt keyCode);

    void OnMouseDown(const TPoint& aPt);
    
    void OnMouseUp(const TPoint& aPt);
    
    void OnInput(const TDesC8& strInput);

    void SizeChanged();  
    
    void ChangeFocus(TBool aFoucs, const TInt& keyCode);
    
    void BeforeBack();
    
protected:
    void AddTabs();

    void BeforeDraw(CFbsBitGc& g) const;   
    
private:
    void CreateControls();
    void LayoutControls();
    void Transfer();
    void ResetData();
    
public:    
    // from MPushButtonObserver
    void PushButtonClicked();
    
public:
	TBool ProcessTradeNetworkMsg(TInt nError, TAny* p, const TDesC8& aBodyData);
	//TBool UpdateTradeNetwork(TInt nProgress);
		
private:
	enum TTransferControl
	{
		ETransferControl_SelectBoxType,
		ETransferControl_OldPwd,
		ETransferControl_NewPwd,
		ETransferControl_ConfirmPwd,
		ETransferControl_ButtonConfirm,
		ETransferControl_ButtonReset,
		ETransferControlCount
	};
	enum TNetworkStatus
	{
		ENetworkStatus_None,
		ENetworkStatus_Req,
		ENetworkStatus_Resp,
	};
private:
    CLabelSelectBox* iSelectBoxPwdType;
        
    CSingleLineTextInput* iEditOldPwd;
    CSingleLineTextInput* iEditNewPwd;
    CSingleLineTextInput* iEditConfirmPwd;
    
    CPushButton* iButtonConfirm;
    CPushButton* iButtonReset;
    
    CControl* iControls[ETransferControlCount];
    TInt iFocusControl;
    TInt iNetworkStatus;
};

#endif // TRADEBLOCKTRANSFER_H
